package com.example.petstoreservice.service;

import com.example.petstoreservice.entity.OrderItems;
import com.example.petstoreservice.mapper.OrderItemMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderItemService {
    @Autowired
    private OrderItemMapper orderItemMapper;
    public List<OrderItems> getAll(){
        return orderItemMapper.getAll();
    }
    public boolean insertOrderItem(OrderItems orderItems){
        int affectRow=orderItemMapper.insertOrderItem(orderItems);
        return affectRow>0;
    }
    public List<OrderItems> getByOrderId(Long orderId){
        return orderItemMapper.display(orderId);
    }
}
